package com.menggudf.enums;

/**
 * 系统字典
 */
public class DataDictionaryEnums {


    public enum ShipmentStatus {
        DRAFT(0, "草稿"),
        ORDERED(1, "已下单"),
        IN_POSITION(2, "已入仓未称重"),
        OUT_POSITION(3, "已出仓"),
        SIGNED(4, "已签收"),
        CANCEL(5, "已取消"),
        EXCEPTION(6, "异常"),
        WEIGHED(7, "已入仓已称重"),
        HAD_WAREHOUSE_RECEIPT(8, "已关联出仓单"),
        BOXED(9, "已装箱"),
        UNBOXED(10, "未装箱"),
        CLEARANCED(11, "已清关"),
        ARRIVED(12, "已到达"),
        DECLEARANCED(13, "报关放行"),
        CHU_JING(14, "已出境"),
        JIAO_CANG(15, "已交仓"),
        IS_CONFIRM(16, "已确认");


        private Integer code;
        private String name;

        ShipmentStatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public static String getNameByCode(int code) {
            for (ShipmentStatus color : ShipmentStatus.values()) {
                if (color.getCode() == code) {
                    return color.getName();
                }
            }
            return null;
        }
    }

    public enum WorkOrderStatus {
        NOT_HANDLED(0, "未处理"),
        HANDLED(1, "已处理");

        private Integer code;
        private String name;

        WorkOrderStatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    public enum WorkOrderWarningStatus {
        NOT_HANDLED(0, "问题件不拦截"),
        HANDLED(1, "问题件拦截");

        private Integer code;
        private String name;

        WorkOrderWarningStatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    public enum WeighingStatus {
        NOT_WEIGH(0, "未称重"),
        WEIGH(1, "已称重");

        private Integer code;
        private String name;

        WeighingStatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    public enum OutWarehouseStatus {
        NO_DISTRIBUTION(0, "未配货"),
        DISTRIBUTION(1, "已配货"),
        CHECKED(2, "已核对"),
        Out(3, "已出仓"),
        DEL(4, "已删除"),
        CANCEL(5, "已作废"),
        HAD_WAREHOUSE_RECEIPT(6, "已关联提单");

        private Integer code;
        private String name;

        OutWarehouseStatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    //提单状态：已订舱0，已出仓提单1，报关放行9，已出境8，已抵达2，异常5，已交仓10
    public enum PickOrderStatus {
        BOOKING(0, "已订舱"),
        HAD_WAREHOUSE_RECEIPT(1, "已出仓提单"),
        ARRIVED(2, "已到达"),
        DECLARE(3, "已清关"),
        SIGN(4, "已签收"),
        EXCEPTION(5, "异常"),
        DEL(6, "已删除"),
        CANCEL(7, "已作废"),
        CHU_JING(8, "已出境"),
        BAO_GUAN_FANG_XING(9, "报关放行"),
        JIAO_CANG(10, "已交仓");

        private Integer code;
        private String name;

        PickOrderStatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public static String getNameByCode(int code) {
            for (PickOrderStatus color : PickOrderStatus.values()) {
                if (color.getCode() == code) {
                    return color.getName();
                }
            }
            return null;
        }
    }

    public enum PackageType {
        BIG(1, "大包"),
        SMALL(2, "小包"),
        BIG_TAIL(3,"大包尾程"),
        SMALL_TAIL(4,"小包尾程");

        private Integer code;
        private String name;

        PackageType(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    public enum ShipmentFrom {
        SYSTEM(1, "系统下单"),
        API(2, "API下单"),
        FAST(3, "快捷下单");

        private Integer code;
        private String name;

        ShipmentFrom(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    public enum SmallStatusEnum {
//0:已创建，1:已装袋，2:已放入出仓单，3:已出仓

        CREATED(0, "已创建"),

        BAGGED(1, "已装袋"),

        PUST_WAREHOUSE(2, "已放入出仓单"),

        OUT_WAREHOUSE(3, "已出仓");

        private Integer code;
        private String name;

        SmallStatusEnum(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    //财务流水状态，0已创建未审核，1已通过，2退回，3撤销，4取消
    public enum FinanceTradeStatus {
        CREATED(0, "已创建未审核"),
        PASS(1, "已通过"),
        EXIT(2, "退回"),
        REVOKE(3, "撤销"),
        CANCEL(4, "取消"),
        PAPER(5, "已开票");

        private Integer code;
        private String name;

        FinanceTradeStatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    //流水类型:1客户充值，2供应商退款，3经营收入，4客户提现，5支付供应商，6经营支出，7提成发放
    public enum FinanceTradeType {
        RECHARGE(1, "客户充值"),
        REFUND(2, "供应商退款"),
        INCOME(3, "经营收入"),
        CASH(4, "客户提现"),
        PAYMENT(5, "支付供应商"),
        EXPENDITURE(6, "经营支出"),
        COMMISSION(7, "提成发放"),
        CUST_PAY(8,"客户扣款")
        ;

        private Integer code;
        private String name;

        FinanceTradeType(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    //账户类型，1客户，2供应商，3公司账户，4员工
    public enum AccountType {
        CUST(1, "客户"),
        SUPPLIER(2, "供应商"),
        ACCOUNT(3, "公司账户"),
        STAFF(4, "员工");

        private Integer code;
        private String name;

        AccountType(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    public enum AccountStatus {
        ENABLE(1, "正常"),
        UNABLE(0, "冻结");

        private Integer code;
        private String name;

        AccountStatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    /**
     *
     */
    public enum BillWay {


        ANKG(1, "按KG"),
        ANLIFANG(2, "按m³"),
        ANPIAO(3, "按票"),
        ANJIAN(4, "按件");
        private Integer code;
        private String name;

        BillWay(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    public static enum ChargingWay {

         SHIZHONG(1, "按实重"),
        CAIJI(2, "按材积"),
        MAXCAIJISHIZHONG(3, "实重材积取最大值");

        private Integer code;
        private String name;

        ChargingWay(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    public static enum BillStatus{
        unPaid(0,"未出账"),
        Paid(1,"已出账"),
        revoked(2,"已撤销"),
        verification(3,"已核销"),
        unVerification(4,"反核销"),
        cancel(5,"作废");

        private Integer code;
        private String name;

        BillStatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    /**
     * 预约取件状态:0未取件，1已取件
     */
    public static enum BookingPickupStatus{
        NO(0,"未取件"),
        YES(1,"已取件");

        private Integer code;
        private String name;

        BookingPickupStatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    public static enum ShipmentWarningStatus{
        NO(0,"不拦截"),
        YES(1,"拦截"),
        OTHER(2,"正常");

        private Integer code;
        private String name;

        ShipmentWarningStatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    public static enum ScanType{
        zero(0,"运单扫描"),
        one(1,"箱号扫描"),
        two(2,"子单号扫描");

        private Integer code;
        private String name;

        ScanType(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    /**
     * 清关方式
     */
    public static enum ClearanceWay{
        ONE("1","包税"),
        TWO("2","不包税"),
        TREE("3","递延");

        private String code;
        private String name;

        ClearanceWay(String code, String name) {
            this.code = code;
            this.name = name;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }


        public static String getEnumValue(String value) {
            for (ClearanceWay color : ClearanceWay.values()) {
                if (color.code.equals(value)) {
                    return color.getName();
                }
            }
            return "";
        }
    }
}
